package com.entity;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Cost {
    private int id;
    private Date costDate;
    private int drugId;     //绑定缴费的药品单
    private String cost;
    private String patientAccount;
    private int isCost;         //是否缴费


    public int getId() {
        return id;
    }

    public Cost(int id, Date costDate, int drugId, String cost, String patientAccount, int isCost) {
        this.id = id;
        this.costDate = costDate;
        this.drugId = drugId;
        this.cost = cost;
        this.patientAccount = patientAccount;
        this.isCost = isCost;
    }

    public Cost() {
    }

    public void setId(int id) {
        this.id = id;
    }

    public Date getCostDate() {
        return costDate;
    }

    public String getCostDateFormat(){
        SimpleDateFormat sdf = new SimpleDateFormat();// 格式化时间
        sdf.applyPattern("yyyy-MM-dd HH:mm:ss");// a为am/pm的标记
        return sdf.format(this.costDate);
    }

    public void setCostDate(Date costDate) {
        this.costDate = costDate;
    }

    public int getDrugId() {
        return drugId;
    }

    public void setDrugId(int drugId) {
        this.drugId = drugId;
    }

    public String getCost() {
        return cost;
    }

    public void setCost(String cost) {
        this.cost = cost;
    }

    public String getPatientAccount() {
        return patientAccount;
    }

    public void setPatientAccount(String patientAccount) {
        this.patientAccount = patientAccount;
    }

    public Cost(Date costDate, int drugId, String cost, String patientAccount) {
        this.costDate = costDate;
        this.drugId = drugId;
        this.cost = cost;
        this.patientAccount = patientAccount;
        this.isCost = 0;
    }

    public String getIsCostString() {
        if(this.isCost==1)
            return "已缴费";
        else
            return "未缴费";

    }
}
